package com.tang.design.Factory;

/**
 * @author tmh
 * @date 2024/5/28 21:29
 * @description
 */
public class ShapeFactory {

    public Shape getShape(String shape){
        if(shape==null){
            return null;
        }
        if(shape.equals("circle")){
            return new CircleShape();
        }else
        if(shape.equals("square")){
            return new SquareShape();
        }else
        if(shape.equals("rectangle")){
            return new Rectangle();
        }
        return null;
    }
}
